﻿using AiXiu.BLL;
using AiXiu.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AiXiu.WebSite.Handler
{
    /// <summary>
    /// VideoDeleteHandler 的摘要说明
    /// </summary>
    public class VideoDeleteHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            // 读取参数
            string videoId = context.Request.Form["videoId"];
            // 删除视频
            VideoBLL videoManager = new VideoBLL();
            OperResult operResult = videoManager.DeleteVideo(videoId);
            // 输出结果
            var data = JsonConvert.SerializeObject(operResult);
            context.Response.Write(data);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}